<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-${model.modelL}-add">
#foreach($field in $fieldList)
#if($field.isPk != "Y"&&${field.inputType}!="none")
#if(${field.inputType}=="date")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8">
			    <div class="input-group"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
			       <input type="text" id="${field.field}" name="${field.field}" class="form-control" value="" placeholder="yyyy-MM-dd"/>
			    </div>
			</div>
		</div>
#elseif(${field.inputType}=="time")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8">
			    <div class="input-group"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
			       <input type="text" id="${field.field}" name="${field.field}" class="form-control" value="" placeholder="HH:mm:ss"/>
			    </div>
			</div>
		</div>
#elseif(${field.inputType}=="datetime")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8">
			    <div class="input-group"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
			       <input type="text" id="${field.field}" name="${field.field}" class="form-control" value="" placeholder="yyyy-MM-dd HH:mm:ss"/>
			    </div>
			</div>
		</div>
#elseif(${field.inputType}=="htmleditor")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8">
		       <script id="${field.field}" name="${field.field}" type="text/plain"> </script>
			</div>
		</div>
#elseif(${field.inputType}=="textarea")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8">
				<textarea rows="6" cols=""  id="${field.field}" name="${field.field}" th:inline="text" class="form-control"></textarea>
			</div>
		</div>
#elseif(${field.inputType}=="select"&&${field.inputValueOne} == "sys_dept")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8"> 
		       <input name="${field.field}"  type="hidden" id="treeId"/>
		       <input type="text" id="treeName" name="treeName" class="form-control" onclick="selectDeptTree()" readonly="true"/>
		    </div>
		</div> 
#elseif(${field.inputType}=="file")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8"> 
				<div>
					<img src="/img/profile.png"  id="${field.field}_image" height="60" width="60"/>
				</div>
		         <div style="width: 80%;float: left;">   
					<input id="${field.field}_uploadfile" name="avatarfile" multiple type="file"> 
					<input type="hidden" name="${field.field}" id="${field.field}_name"/>
				</div>
				<button type="button" class="btn btn-primary" onclick="javascript:${field.field}_fileUpload()" style="float: right;">上传</button>
		    </div>
		</div> 
#elseif(${field.inputType}=="radio")
#if(${field.inputValue} == "")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8"> 
		      <div class="onoffswitch">
                         <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="${field.field}" name="${field.field}"/>
                         <label class="onoffswitch-label" for="${field.field}">
                             <span class="onoffswitch-inner"></span>
                             <span class="onoffswitch-switch"></span>
                         </label>
              </div>
            </div>
		</div>
#else
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
				<div class="col-sm-8" th:with="type=${@dictService.selectDictData('${field.inputValue}')}">
					<label th:each="dict : ${type}" class="checkbox-inline i-checks">
						<input type="radio" th:id="${dict['dictCode']}" name="${field.field}" th:value="${dict['dictValue']}" th:checked="${ dict['isDefault'] == '0' ? true : false}" th:text="${dict['dictLabel']}"/> 
					</label> 
				</div>
		</div>
#end 
#elseif(${field.inputType}=="select")
#if(${field.inputValueTwo} == "")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8"> 
		      <select id="${field.field}" name="${field.field}" class="form-control m-b" th:with="type=${@dictService.selectDictData('${field.inputValue}')}">
                  <option value="">请选择</option>
                   <option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
               </select>
            </div>
		</div> 
#elseif(${field.inputValueTwo} != "")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8"> 
		      <select id="${field.field}" name="${field.field}" class="form-control m-b" th:with="type=${ @${field.inputValueOneU}ServiceImpl.selectAll()}">
                  <option value="">请选择</option>
                   <option th:each="dict : ${type}" th:text="${ dict.${field.inputValueTwoL}}" th:value="${dict.id}"></option>
               </select>
            </div>
		</div> 
#end
#elseif(${field.inputType}=="checkbox")
#if(${field.inputValueTwo} == "")
         <div class="form-group">	
		    <label class="col-sm-3 control-label">${field.comment}：</label>
			<div class="col-sm-8"> 
		     <label th:each="dict:${@dictService.selectDictData('${field.inputValue}')}" class="checkbox-inline i-checks" >
				<input name="${field.field}" type="checkbox" th:value="${dict['dictValue']}" th:text="${dict['dictLabel']}"/>
			</label>
            </div>
		</div> 
#end
#else
        <div class="form-group">	
            <label class="col-sm-3 control-label">${field.comment}：</label>
            <div class="col-sm-8">
                <input id="${field.field}" name="${field.field}" class="form-control" type="text" placeholder="请输入${field.comment}"/>
            </div>
        </div>
#end
#end
#end
       <div class="form-group">
		<div class="form-control-static col-sm-offset-9">
			<button type="submit" class="btn btn-primary">提交</button>
			<button th:onclick="'javascript:layer_close()'" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
    </div>

    <div th:include="include::footer"></div>
    
<script type="text/javascript" th:inline="javascript">
	layui.use('laydate', function(){
	  var laydate = layui.laydate;
#foreach($field in $fieldList)
#if(${field.inputType}=="datetime")
  //日期时间选择器
  laydate.render({
    elem: '#${field.field}'
    ,type: 'datetime'
  });
#elseif(${field.inputType}=="date")
  laydate.render({
    elem: '#${field.field}'
  });
#elseif(${field.inputType}=="time")
  laydate.render({
    elem: '#${field.field}'
    ,type: 'time'
  });
#end
#end	  
	   });


#foreach($field in $fieldList)
#if(${field.inputType}=="htmleditor")
	var ue_${field.field} = UE.getEditor('${field.field}');
#end
#end 
</script> 
    <script th:src="@{/jee/${model.modulePackage}/${model.modelL}/add.js}">
    </script>
</body>
</html>
